<%@ page import="java.sql.DriverManager" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.PreparedStatement" %>
<%@ page import="java.sql.ResultSet" %><%--
  Created by IntelliJ IDEA.
  User: 吧
  Date: 2020/12/1
  Time: 14:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>修改教师信息</title>
</head><link rel="stylesheet" href="css/bootstrap.css"><script src="js/jquery.min.js"></script>
<script src="js/bootstrap.bundle.js"></script>
<script src="js/bootstrap.js"></script>
<style>
    .table{
margin-left: -15%;

    }


</style>
<body  background="5.jpg">
<form  action="UpdateNews2.jsp" method="get">

    <%
        Class.forName("com.mysql.jdbc.Driver");
        String url="jdbc:mysql://localhost:3306/lixiuying";
        Connection connection= DriverManager.getConnection(url,"root","root");
        String sql="select * from teacher where id=?";
        PreparedStatement pstm=connection.prepareStatement(sql);
        pstm.setInt(1,Integer.parseInt(request.getParameter("id")));
        ResultSet rs=pstm.executeQuery();
        session.setAttribute("ID",request.getParameter("id"));
    %>

    <div class="container">
        <div class="row clearfix">
            <div class="col-md-12 column" align="center">
                <h2 align="center">修改用户！</h2>
                <div align="left" ><a href="SelectNews.jsp"><font size="+2">返回教师信息页面</font></a></div>
                <table class="table table-hover table-striped" >
                    <thead>
                    <tr>
                        <th></th>
                        <th >
                          编号
                        </th>
                        <th>
                            姓名
                        </th>
                        <th>
                            年龄
                        </th>
                        <th>
                            性别
                        </th>
                        <th>
                            电话
                        </th>
                        <th>
                            邮箱
                        </th>
                        <th>
                            地址
                        </th>



                    </tr>
                    </thead>
                    <tbody>
                    <%
                        while( rs.next())
                        {
                            out.print("<tr>");
                            out.print( "<td>"+"原信息"+
                                    "</td><td>"+rs.getString("id")+
                                            "</td><td>"+rs.getString("name")+
                                            "</td><td>"+rs.getInt("age")+
                                            "</td><td>"+rs.getInt("sex")+
                                            "</td><td>"+rs.getString("tel")+
                                            "</td><td>"+rs.getString("email")+
                                            "</td><td>"+rs.getString("address")+
                                            "</td>");
                            out.print("</tr>");

                        }%>


                    <tr>


                        <td>修改信息</td>
                        <td><input type="text" name="UpdateId" ></td>
                        <td><input type="text" name="UpdateserName"></td>
                        <td><input type="text" name="UpdateAge"></td>
                        <td><input type="text" name="UpdateSex" ></td>
                        <td><input type="text" name="UpdateserTel"></td>
                        <td><input type="text" name="UpdateEmail"></td>
                        <td><input type="text" name="UpdateAddress"></td>
                    </tr>
                    <tr><td colspan="8" style="text-align: center;"><input type="submit" value="提交"></td></tr>

                    </tbody>
                </table>
            </div>
        </div>
    </div>
</form>
</body>
</html>
